/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Monitores;

/**
 *
 * @author 21322325
 */
public class Monitor {
    
    public Monitor(){
        System.out.println("M : Al ataqueeeeeeeeeeeeeerrrr!");
    }
    
    public synchronized void entrar (String id) {
        System.out.println("Ha entrado : " + id);
        for (int i=0;i<5;i++){
            try{
                System.out.println("->" + id + "("+i + ")");
                Thread.sleep(1000);
            }catch (InterruptedException e){
                e.printStackTrace();
            }
         System.out.println();
        }
        System.out.println("\n El más guay : "+ id + ",he pasado del monitor");
    }
}
